#!/usr/bin/perl
use strict;
use warnings;
use Config::Properties;

my $REPOS = shift;
my $TXN= shift;

open PROPS, "<", "/username.props" or die "can't open file"; 

my $properties=new Config::Properties();
$properties->load(*PROPS);
my $username = $properties->getProperty("username");

#my hook script to block delete
my @svnlook= `/usr/bin/svnlook changed -t $TXN $REPOS`;
chomp(@svnlook);

foreach my $svnlook (@svnlook)
{
  my $user = `svnlook author -t $TXN $REPOS`;
  if(($user =~ m/sumbal/) && ($svnlook =~ m/^D /))
   {
     print STDERR "Error: Permission to delete denied for ", $user, ". \n";
     exit 1;
   }
   exit 0; 
}
